package com.wangrui.dao;

import com.wangrui.entity.User;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface UserMapper6 {
    List<User> selectByCondition(User user);

    List<User> selectByMap(Map<String, Object> map);

    List<User> selectByMap2(Integer min, Integer max);

    //如果返回Map<String, Object>，加上@MapKey注解之后，会返回一个Map，key为注解的值，value为查询结果的键值对Map
    //如果返回List<Map<String,Object>>,@MapKey注解不起作用
    @MapKey("name")
    List<Map<String, Object>> selectForMap();

    List<User> selectByMultiParam(String name, int age);

    List<User> selectByNamedParam(@Param("name") String name, @Param("age") int age);

    List<User> selectByCompressParam(@Param("name") String name, @Param("user") User user);

    List<User> selectByListParam1(/*@Param("ids")*/ List<Integer> ids);

    List<User> selectByListParam2(List<Integer> ids, String name);

    List<User> selectByDataCondition(Date birth);
}
